package leetcode.editor.week.week301;

import java.util.Arrays;

public class Solution6112 {
    class Solution {
        public int fillCups(int[] amount) {
            Arrays.sort(amount);
            if(amount[0] + amount[1] <= amount[2]) return amount[2];
            else {
                int t = amount[1] + amount[0] - amount[2];
                return (t + 1) / 2 + amount[2];
            }
        }
    }
}
